<extend name="Layout/ins_page" />
<block name="content">
	{:W('PageHeader/simple',array('name'=>'编辑入库产品','search'=>'N'))}
	<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"   class="well form-horizontal">
		<input type="hidden" id="ajax" name="ajax" value="1" />	
		<input type="hidden" name="id" value="{$result.id}" />		
		<div class="form-group col-sm-6">
			<label class="col-sm-4 control-label" for="bank" >库存类别：</label>
			<div class="col-sm-8">
				<select id="product_type_id" name="product_type_id" class="form-control" check="require" msg="请选择库存类别">
					<option value="" >请选择库存类别</option>
					<notempty  name="product_type">
						<foreach name="product_type" item="vo">
							<option value="{$vo['id']}" <if condition="$vo['id'] eq $result['product_type_id']">selected="selected"</if> >{$vo['type_name']}<php>echo empty($flag[$vo['flag']]) ? '' : '|' . $flag[$vo['flag']]</php></option>
						</foreach>						
					</notempty >
				</select>
			</div>
		</div>
		<div class="form-group col-sm-6">
			<label class="col-sm-4 control-label" for="bank" >产品名称：</label>
			<div class="col-sm-8">
				<input  class="form-control" type="text" id="product" name="product" value="{$result.product}" check="require" msg="请输入产品名称" />
			</div>
		</div>
		<div class="form-group col-sm-6">
			<label class="col-sm-4 control-label" for="no">产品编号：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" id="product_bh" name="product_bh" value="{$result.product_bh}" check="require" msg="请输入产品编号" />
			</div>
		</div>
		<if condition="$result['product_img'] neq '' ">
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="name">图片：</label>
				<div class="col-sm-8">
					<img src="/Uploads/store/{$result['product_img']}" style="width:auto;height:180px"/>
				</div>
			</div>
		</if>
		<div class="form-group">
			<div class="action col-sm-10 col-sm-offset-2">
				<input class="btn btn-sm btn-primary" type="button" value="保存" onclick="save();" />
				<input class="btn btn-sm btn-default" type="button" value="取消" onClick="javascript:history.go(-1);" />
			</div>
		</div>
	</form>
</block>
<block name="js">
	<script>
		function save() {
			sendForm("form_data", "{:U('saveProduct')}", "{:U('product')}");
		}
	</script>
</block>